package com.shengyuan.manage_os.old.ying.erpm;

import com.shengyuan.manage_os.R;

import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;

public class Actual_Form_BaoYang extends PreferenceActivity 
	implements OnSharedPreferenceChangeListener {
	public static Actual_Form_BaoYang Instance;
	public String mValue;
	SharedPreferences  sp;
	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Instance = this;
		addPreferencesFromResource(R.xml.baoyangpreference);
		sp = PreferenceManager.getDefaultSharedPreferences(this); 
		sp.registerOnSharedPreferenceChangeListener(this); 
	}
	
	@Override
	@Deprecated
	public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
			Preference preference) {
		return super.onPreferenceTreeClick(preferenceScreen, preference);
	}


	@Override
	protected void onDestroy() {
		mValue = "";
		SharedPreferences prefs =PreferenceManager.getDefaultSharedPreferences(this) ;
		for (int i = 1; i <= 15; i++) {
			boolean b =  prefs.getBoolean("key"+i, false);
			int pk = b ? 1: 0;
			mValue +=  pk + ",";
		}
		super.onDestroy();
	}

	@Override
	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
			String key) {
		// TODO Auto-generated method stub
		
	}
}